package org.example.domain.user_raffle.service;

import org.example.domain.user_raffle.model.entity.ActivityStrategyPrizeEntity;
import org.example.domain.user_raffle.model.entity.PrizeEntity;
import org.example.domain.user_raffle.model.entity.StockZeroTaskEntity;

import java.util.List;
import java.util.Map;

/**
 * @author lxc18
 * @date 2025/3/29 16:36
 * @description IUserRaffleService
 */
public interface IUserRaffleService {
    //活动是否有效
    boolean isActivityValid(Long activityId);
    //验证用户额度是否大于0
    boolean isUserQuotaValid(Long activityId,Long userId);
    //3、参与抽奖：
    Long participateInRaffle(Long activityId, Long userId,int quota);
    //根据抽奖的返回值，进行后续操作
    Long processResult(int status);
    boolean isGuaranteePrize(Long activityId,Long prizeId);
    //用户额度扣减、已用额度增加
    int deductUserQuotaAndAddUsedQuota(Long activityId,Long userId);
    //用户抽奖记录增加
    boolean addUserRaffleRecord(Long activityId,Long userId,Long prizeId);

    //获取所有奖品id
    List<Long> getAllPrizeIds();

    void decrPrizeStock(Long prizeId,int size);

    PrizeEntity queryPrizeById(Long prizeId);

    void clearUsedQuota(Long activityId, Long userId,int quota);

    void updateStockToZero(Long prizeId);

    void updateStatusSuccess(Long id);

    void updateStatusFailed(Long id);

    boolean isTaskStockZero(Long id);

    List<StockZeroTaskEntity> getAllFailedTaskIds();
}
